package com.tangchao.client.sdh.definition
{
	import flash.display.MovieClip;
	import flash.utils.getDefinitionByName;

	public class DFGetCard
	{
//		static public function getCardByIndex(i:int):MovieClip
//		{
//			var name:String="sandaha_card"+i;
//			var cls:Class=getDefinitionByName(name) as Class;
//			var mc:MovieClip=new cls();
//			return mc;
//		}
		
		static public function getCardByIndex(i:int):MovieClip
		{
			var cardNum:int = i;
			var color:int = cardNum/11;
			var num:int = cardNum%11;
			num = num>2 ? num+2: num;
			cardNum = color * 13 + num;
			var name:String="sandaha_card"+cardNum;
			var cls:Class=getDefinitionByName(name) as Class;
			var mc:MovieClip=new cls();
			return mc;
		}
		
		static public function getNumByNum(i:int):MovieClip
		{
			var name:String="sandaha_num"+i;
			var cls:Class=getDefinitionByName(name) as Class;
			var mc:MovieClip=new cls();
			return mc;
		}
	}
}